import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_base/23_pageview/siwperWidget.dart';

/// 带有定时器的轮播图

void main() {
  runApp(MaterialApp(
    home: MySwiper(),
  ));
}

class MySwiper extends StatefulWidget {
  const MySwiper({super.key});

  @override
  State<MySwiper> createState() => _MySwiperState();
}

class _MySwiperState extends State<MySwiper> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('轮播图展示'),
      ),
      body: SizedBox(
        height: 220,
        width: double.infinity,
        child: Swiper(bgUrls: const [
          'https://www.itying.com/images/flutter/1.png',
          'https://www.itying.com/images/flutter/2.png',
          'https://www.itying.com/images/flutter/3.png',
          'https://www.itying.com/images/flutter/4.png',
        ]),
      ),
    );
  }
}
